3.14 \(\int \csc ^2(c+d x) (a+a \sec (c+d x)) \, dx\)

Optimal. Leaf size=37 \[ -\frac {a \cot (c+d x)}{d}-\frac {a \csc (c+d x)}{d}+\frac {a \tanh ^{-1}(\sin (c+d x))}{d} \]

[Out]

a*arctanh(sin(d*x+c))/d-a*cot(d*x+c)/d-a*csc(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.09, antiderivative size = 37, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.368, Rules used = {3872, 2838, 2621, 321, 207, 3767, 8} \[ -\frac {a \cot (c+d x)}{d}-\frac {a \csc (c+d x)}{d}+\frac {a \tanh ^{-1}(\sin (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[Csc[c + d*x]^2*(a + a*Sec[c + d*x]),x]

[Out]

(a*ArcTanh[Sin[c + d*x]])/d - (a*Cot[c + d*x])/d - (a*Csc[c + d*x])/d

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2621

Int[(csc[(e_.) + (f_.)*(x_)]*(a_.))^(m_)*sec[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> -Dist[(f*a^n)^(-1), Subst
[Int[x^(m + n - 1)/(-1 + x^2/a^2)^((n + 1)/2), x], x, a*Csc[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && Integer
Q[(n + 1)/2] &&  !(IntegerQ[(m + 1)/2] && LtQ[0, m, n])

Rule 2838

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)
*(x_)]), x_Symbol] :> Dist[a, Int[(g*Cos[e + f*x])^p*(d*Sin[e + f*x])^n, x], x] + Dist[b/d, Int[(g*Cos[e + f*x
])^p*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3872

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Int[((g*C
os[e + f*x])^p*(b + a*Sin[e + f*x])^m)/Sin[e + f*x]^m, x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]

Rubi steps

\begin {align*} \int \csc ^2(c+d x) (a+a \sec (c+d x)) \, dx &=-\int (-a-a \cos (c+d x)) \csc ^2(c+d x) \sec (c+d x) \, dx\\ &=a \int \csc ^2(c+d x) \, dx+a \int \csc ^2(c+d x) \sec (c+d x) \, dx\\ &=-\frac {a \operatorname {Subst}(\int 1 \, dx,x,\cot (c+d x))}{d}-\frac {a \operatorname {Subst}\left (\int \frac {x^2}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}\\ &=-\frac {a \cot (c+d x)}{d}-\frac {a \csc (c+d x)}{d}-\frac {a \operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}\\ &=\frac {a \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a \cot (c+d x)}{d}-\frac {a \csc (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.03, size = 41, normalized size = 1.11 \[ -\frac {a \csc (c+d x) \, _2F_1\left (-\frac {1}{2},1;\frac {1}{2};\sin ^2(c+d x)\right )}{d}-\frac {a \cot (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[c + d*x]^2*(a + a*Sec[c + d*x]),x]

[Out]

-((a*Cot[c + d*x])/d) - (a*Csc[c + d*x]*Hypergeometric2F1[-1/2, 1, 1/2, Sin[c + d*x]^2])/d

________________________________________________________________________________________

fricas [A]  time = 0.66, size = 63, normalized size = 1.70 \[ \frac {a \log \left (\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) - a \log \left (-\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) - 2 \, a \cos \left (d x + c\right ) - 2 \, a}{2 \, d \sin \left (d x + c\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2*(a+a*sec(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(a*log(sin(d*x + c) + 1)*sin(d*x + c) - a*log(-sin(d*x + c) + 1)*sin(d*x + c) - 2*a*cos(d*x + c) - 2*a)/(d
*sin(d*x + c))

________________________________________________________________________________________

giac [A]  time = 0.34, size = 50, normalized size = 1.35 \[ \frac {a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2*(a+a*sec(d*x+c)),x, algorithm="giac")

[Out]

(a*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - a*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - a/tan(1/2*d*x + 1/2*c))/d

________________________________________________________________________________________

maple [A]  time = 0.60, size = 47, normalized size = 1.27 \[ -\frac {a \cot \left (d x +c \right )}{d}-\frac {a}{d \sin \left (d x +c \right )}+\frac {a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(d*x+c)^2*(a+a*sec(d*x+c)),x)

[Out]

-a*cot(d*x+c)/d-1/d*a/sin(d*x+c)+1/d*a*ln(sec(d*x+c)+tan(d*x+c))

________________________________________________________________________________________

maxima [A]  time = 0.37, size = 50, normalized size = 1.35 \[ -\frac {a {\left (\frac {2}{\sin \left (d x + c\right )} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + \frac {2 \, a}{\tan \left (d x + c\right )}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2*(a+a*sec(d*x+c)),x, algorithm="maxima")

[Out]

-1/2*(a*(2/sin(d*x + c) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) + 2*a/tan(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 0.96, size = 29, normalized size = 0.78 \[ \frac {a\,\left (2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a/cos(c + d*x))/sin(c + d*x)^2,x)

[Out]

(a*(2*atanh(tan(c/2 + (d*x)/2)) - cot(c/2 + (d*x)/2)))/d

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ a \left (\int \csc ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int \csc ^{2}{\left (c + d x \right )}\, dx\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)**2*(a+a*sec(d*x+c)),x)

[Out]

a*(Integral(csc(c + d*x)**2*sec(c + d*x), x) + Integral(csc(c + d*x)**2, x))

________________________________________________________________________________________